import request from '@/utils/request'

export function getOrgTree(params) {
    return request({
        url: `/api/v1/core/organization/tree`,
        method: 'post',
        data: params
    })
}

export function getOrgList(params) {
    return request({
        url: `/api/v1/core/organization/list`,
        method: 'post',
        data: params
    })
}

export function addOrg(params) {
    return request({
        url: `/api/v1/core/organization/add`,
        method: 'post',
        data: params
    })
}

export function updateOrg(params) {
    return request({
        url: `/api/v1/core/organization/update`,
        method: 'post',
        data: params
    })
}

export function deleteOrg(params) {
    return request({
        url: `/api/v1/core/organization/delete?id=${params.id}`,
        method: 'get'
    })
}

export function getOrgIds(params) {
    return request({
        url: `/api/v1/core/organization/ids?companyId=${params.companyId}`,
        method: 'get'
    })
}
